#ifndef HISTORYDAO_H
#define HISTORYDAO_H

#include "basedao.h"
#include "../data.h"
#include <QDateTime>

class HistoryDao : public BaseDao<HistoryItemInfo>
{
public:
    explicit HistoryDao(QObject *parent = nullptr);

    // 实现基类纯虚函数
    PrimaryKeyStrategy primaryKeyStrategy() const override;
    QString tableName() const override;
    QString primaryKey() const override;
    HistoryItemInfo mapToEntity(const QVariantMap &row) const override;
    QVariantMap entityToMap(const HistoryItemInfo &entity) const override;

    // 历史记录特定方法
    QList<HistoryItemInfo> findByUserId(qint64 userId, int limit, int offset);
    QList<HistoryItemInfo> findByUserIdAndType(qint64 userId, const QString &processType, int limit, int offset);
    int countByUserId(qint64 userId);
    bool deleteByFileId(qint64 fileId);
    bool deleteByUserId(qint64 userId);
};

#endif // HISTORYDAO_H
